///**
// * @author DELL
// * @createDate 2016/11/15 14:26
// * @copyright 广州市生物制品有限公司
// * @description 未经本公司许可，不得以任何方式复制或使用本程序任何部分
// */
//package com.lzw.handler;
//
//import com.lzw.command.DebitAccountCommand;
//import com.lzw.entity.Account;
//import org.axonframework.commandhandling.annotation.CommandHandler;
//import org.axonframework.repository.Repository;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
///**
// * 类功能描述: TODO
// *
// * @author 12360
// * @version 1.0
// * @createDate Nov 19, 2015 11:16:44 AM
// */
//@Component
//public class DebitAccountCommandHandler {
//
//    @Autowired
//    private Repository repository;
//
//    @CommandHandler
//    public void handle(DebitAccountCommand debitAccountCommand) throws Throwable {
///*        DebitAccountCommand debitAccountCommand = (DebitAccountCommand) commandMessage.getPayload();
//        String account = debitAccountCommand.getAccount();
//        Double amount = debitAccountCommand.getAmount();
//        System.out.println("I can handle the debitAccount command: "
//                + "Account to debit: " + account
//                + " Amount to debit with: " + amount);*/
//        Account accountToDebit = (Account) repository.load(debitAccountCommand.getAccount());
//        accountToDebit.debit(debitAccountCommand.getAmount());
//    }
//}
